#include "VuzixController.h"
#include <iostream>
#include "MainController.h"

using namespace irr;

VuzixController::VuzixController(){}

void VuzixController::update() {
    if (VuzixGlasses::getLunettesInstance()->getState() != IWR_OFF){
        LONG yaw;
        LONG pitch;
        LONG roll;
        VuzixGlasses::getLunettesInstance()->getTracking(&yaw,&pitch,&roll);

        irr::SEvent event;
        event.EventType = irr::EET_USER_EVENT;
        event.UserEvent.UserData1 = EVENT_IWR_ROT_YAW;
        event.UserEvent.UserData2 = 180* yaw / 32768;
        MainController::getMainControleurInstance()->getDevice()->postEventFromUser(event);

        irr::SEvent event2;
        event2.EventType = irr::EET_USER_EVENT;
        event2.UserEvent.UserData1 = EVENT_IWR_ROT_PITCH;
        event2.UserEvent.UserData2 = 180* pitch / 32768;
        MainController::getMainControleurInstance()->getDevice()->postEventFromUser(event2);
    }
}




